package com.yiwei.zxp.api.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xsooy-pc on 18-5-23.
 */

public class GoodsAddBean implements Parcelable {


    /**
     * photos : ["/2018/05/23/201805231024507830.jpg","/2018/05/23/201805231024507830.jpg","/2018/05/23/201805231024507830.jpg"]
     * title : 老乌龟一只
     * price : 998
     * deliver_fee : 25
     * province_id : 1
     * city_id : 2
     * cate_id : 35
     * params : [{"name":"我是标题","value":"我是内容"},{"name":"我是标题1","value":"我是内容2"}]
     * details : ["/2018/05/23/201805231024507830.jpg","/2018/05/23/201805231024507830.jpg","/2018/05/23/201805231024507830.jpg"]
     */
    public String goods_no;
    public String title;
    public String price;
    public String inventory;
    public String deliver_fee;
    public String province_id;
    public String city_id;
    public String cate_id;
    public List<String> photos = new ArrayList<>();
    public List<ParamsBean> params;
    public ArrayList<String> details = new ArrayList<>();


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.goods_no);
        dest.writeString(this.title);
        dest.writeString(this.price);
        dest.writeString(this.inventory);
        dest.writeString(this.deliver_fee);
        dest.writeString(this.province_id);
        dest.writeString(this.city_id);
        dest.writeString(this.cate_id);
        dest.writeStringList(this.photos);
        dest.writeTypedList(this.params);
        dest.writeStringList(this.details);
    }

    public GoodsAddBean() {
    }

    protected GoodsAddBean(Parcel in) {
        this.goods_no = in.readString();
        this.title = in.readString();
        this.price = in.readString();
        this.deliver_fee = in.readString();
        this.province_id = in.readString();
        this.inventory = in.readString();
        this.city_id = in.readString();
        this.cate_id = in.readString();
        this.photos = in.createStringArrayList();
        this.params = in.createTypedArrayList(ParamsBean.CREATOR);
        this.details = in.createStringArrayList();
    }

    public static final Creator<GoodsAddBean> CREATOR = new Creator<GoodsAddBean>() {
        @Override
        public GoodsAddBean createFromParcel(Parcel source) {
            return new GoodsAddBean(source);
        }

        @Override
        public GoodsAddBean[] newArray(int size) {
            return new GoodsAddBean[size];
        }
    };
}
